package org.i1510.common.controller;

import javax.annotation.PostConstruct;

import org.i1510.common.service.ILoad;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;


@ServletComponentScan(value="org.i1510.base.load")
@SpringBootApplication
@ComponentScan("org.i1510.*")
public class Application extends SpringBootServletInitializer implements EmbeddedServletContainerCustomizer{

	
    @Autowired
    private ILoad iLoad;

    @PostConstruct
    public void init(){
    	iLoad.init();
    }

    
    
    public static void main(String[] args){
        SpringApplication.run(Application.class, args);

    }

	public void customize(ConfigurableEmbeddedServletContainer container) {
		// TODO Auto-generated method stub
		container.setPort(8099);
		
	}
}
